import type { Plugin } from 'vue'
import MyViewer from './components/MyViewer/index.vue'

const components = [
  MyViewer,
]

// 创建插件函数
const createComponentPlugin = (component: any, name?: string): Plugin => ({
  install(app) {
    app.component(name || component.name || component.__name, component)
  }
})

const plugins = components.map(component =>{
  return createComponentPlugin(component,component.name)
})

export default plugins